package com.cskaoyan.market.service.impl;

import com.cskaoyan.market.db.domain.MarketUser;
import com.cskaoyan.market.db.domain.MarketUserExample;
import com.cskaoyan.market.db.mapper.MarketUserMapper;
import com.cskaoyan.market.service.MarketWXAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class MarketWXAuthServiceImpl implements MarketWXAuthService {

    @Autowired
    MarketUserMapper marketUserMapper;
    @Override
    public List<MarketUser> login(MarketUser marketUser) {

        MarketUserExample marketUserExample = new MarketUserExample();
        MarketUserExample.Criteria or = marketUserExample.or();
        or.andDeletedEqualTo(false);
        or.andUsernameEqualTo(marketUser.getUsername());
        or.andPasswordEqualTo(marketUser.getPassword());
        List<MarketUser> marketUsers = marketUserMapper.selectByExample(marketUserExample);
        return marketUsers;
    }
}
